add this function, bug 40251
authorHavoc Pennington <hp@redhat.com>
Thu, 11 Jan 2001 17:59:40 +0000 (17:59 +0000)
committerHavoc Pennington <hp@src.gnome.org>
Thu, 11 Jan 2001 17:59:40 +0000 (17:59 +0000)
2001-01-10  Havoc Pennington  <hp@redhat.com>

* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes):
add this function, bug 40251

* gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name
of type macro

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktreemodelsimple.h
gtk/gtktreeviewcolumn.c
gtk/gtktreeviewcolumn.h

index 3c6ce731e662ef4a37da2a04f463ad181f5b3f08..616871335f8c7eb4701923f09f37842f54c79302 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2001-01-10  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes):
+       add this function, bug 40251
+
+       * gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name
+       of type macro   
+
 2001-01-11  Alexander Larsson  <alexl@redhat.com>
 
        * acconfig.h:
index 3c6ce731e662ef4a37da2a04f463ad181f5b3f08..616871335f8c7eb4701923f09f37842f54c79302 100644 (file)
@@ -1,3 +1,11 @@
+2001-01-10  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes):
+       add this function, bug 40251
+
+       * gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name
+       of type macro   
+
 2001-01-11  Alexander Larsson  <alexl@redhat.com>
 
        * acconfig.h:
index 3c6ce731e662ef4a37da2a04f463ad181f5b3f08..616871335f8c7eb4701923f09f37842f54c79302 100644 (file)
@@ -1,3 +1,11 @@
+2001-01-10  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes):
+       add this function, bug 40251
+
+       * gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name
+       of type macro   
+
 2001-01-11  Alexander Larsson  <alexl@redhat.com>
 
        * acconfig.h:
index 3c6ce731e662ef4a37da2a04f463ad181f5b3f08..616871335f8c7eb4701923f09f37842f54c79302 100644 (file)
@@ -1,3 +1,11 @@
+2001-01-10  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes):
+       add this function, bug 40251
+
+       * gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name
+       of type macro   
+
 2001-01-11  Alexander Larsson  <alexl@redhat.com>
 
        * acconfig.h:
index 3c6ce731e662ef4a37da2a04f463ad181f5b3f08..616871335f8c7eb4701923f09f37842f54c79302 100644 (file)
@@ -1,3 +1,11 @@
+2001-01-10  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes):
+       add this function, bug 40251
+
+       * gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name
+       of type macro   
+
 2001-01-11  Alexander Larsson  <alexl@redhat.com>
 
        * acconfig.h:
index 3c6ce731e662ef4a37da2a04f463ad181f5b3f08..616871335f8c7eb4701923f09f37842f54c79302 100644 (file)
@@ -1,3 +1,11 @@
+2001-01-10  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes):
+       add this function, bug 40251
+
+       * gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name
+       of type macro   
+
 2001-01-11  Alexander Larsson  <alexl@redhat.com>
 
        * acconfig.h:
index 3c6ce731e662ef4a37da2a04f463ad181f5b3f08..616871335f8c7eb4701923f09f37842f54c79302 100644 (file)
@@ -1,3 +1,11 @@
+2001-01-10  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes):
+       add this function, bug 40251
+
+       * gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name
+       of type macro   
+
 2001-01-11  Alexander Larsson  <alexl@redhat.com>
 
        * acconfig.h:
index b544899a61f126b51d10f2a7eac7605e074328ef..43720ac39acd3b6bbeaee2d5d5e2d3bd8128e169 100644 (file)
@@ -27,7 +27,7 @@ extern "C" {
 #endif /* __cplusplus */
 
 
-#define GTK_TYPE_MODEL_SIMPLE                  (gtk_tree_model_simple_get_type ())
+#define GTK_TYPE_TREE_MODEL_SIMPLE                     (gtk_tree_model_simple_get_type ())
 #define GTK_TREE_MODEL_SIMPLE(obj)                     (GTK_CHECK_CAST ((obj), GTK_TYPE_MODEL_SIMPLE, GtkTreeModelSimple))
 #define GTK_TREE_MODEL_SIMPLE_CLASS(klass)             (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_MODEL_SIMPLE, GtkTreeModelSimpleClass))
 #define GTK_IS_TREE_MODEL_SIMPLE(obj)          (GTK_CHECK_TYPE ((obj), GTK_TYPE_MODEL_SIMPLE))
index e03afe3eb478adcec5d3f51f24f419bd2e0b99a7..9efa9e1d82649bcb5ea8dcc0b972fc20c9c4c8a5 100644 (file)
@@ -495,7 +495,6 @@ static void
 gtk_tree_view_column_set_attributesv (GtkTreeViewColumn *tree_column,
                                      va_list            args)
 {
-  GSList *list;
   gchar *attribute;
   gint column;
 
@@ -504,16 +503,8 @@ gtk_tree_view_column_set_attributesv (GtkTreeViewColumn *tree_column,
 
   attribute = va_arg (args, gchar *);
 
-  list = tree_column->attributes;
-
-  while (list && list->next)
-    {
-      g_free (list->data);
-      list = list->next->next;
-    }
-  g_slist_free (tree_column->attributes);
-  tree_column->attributes = NULL;
-
+  gtk_tree_view_column_clear_attributes (tree_column);
+  
   while (attribute != NULL)
     {
       column = va_arg (args, gint);
@@ -550,6 +541,31 @@ gtk_tree_view_column_set_attributes (GtkTreeViewColumn *tree_column,
   va_end (args);
 }
 
+/**
+ * gtk_tree_view_column_clear_attributes:
+ * @tree_column: a #GtkTreeViewColumn
+ * 
+ * Clears all existing attributes previously set with
+ * gtk_tree_view_column_set_attributes().
+ **/
+void
+gtk_tree_view_column_clear_attributes (GtkTreeViewColumn *tree_column)
+{
+  GSList *list;
+  
+  g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
+
+  list = tree_column->attributes;
+
+  while (list && list->next)
+    {
+      g_free (list->data);
+      list = list->next->next;
+    }
+  g_slist_free (tree_column->attributes);
+  tree_column->attributes = NULL;
+}
+
 /**
  * gtk_tree_view_column_set_cell_data:
  * @tree_column: A #GtkTreeViewColumn.
index d10a7663aa3678a267de81655b5dd6c6425715ec..7a98ff6dbc0dfc19522953318822d4d64a0cbcf5 100644 (file)
@@ -95,6 +95,7 @@ void               gtk_tree_view_column_add_attribute       (GtkTreeViewColumn
                                                             gint                   column);
 void               gtk_tree_view_column_set_attributes      (GtkTreeViewColumn     *tree_column,
                                                             ...);
+void               gtk_tree_view_column_clear_attributes    (GtkTreeViewColumn     *tree_column);
 void               gtk_tree_view_column_set_cell_data       (GtkTreeViewColumn     *tree_column,
                                                             GtkTreeModel          *tree_model,
                                                             GtkTreeIter           *iter);